package com.neusoft.classch74.cola;

public class HourlyEmployee extends ColaEmployee {

	//每小时的工资
	private double hourlySalay;
	//每月工作的小时数
	private double hours;
	
	
	
	
	
	@Override
	public double calculateSalary(int month) {
		//定义工资
		double salary=0 ;
		//计算每个月的工资
		if(hours>160) {
			salary=hourlySalay*160+(hours-160)*hourlySalay*1.5;
		}else if(hours>0) {
			salary = hourlySalay*hours;
		}else {
			System.out.println("月工时输入有误");
		}
		
		return salary+super.calculateSalary(month);
	}
	public HourlyEmployee() {
		super();
	}
	public HourlyEmployee(String empName, int empBirthMonth,double hourlySalay,double hours) {
		super(empName, empBirthMonth);
		this.hourlySalay=hourlySalay;
		this.hours = hours;
	}
	public double getHourlySalay() {
		return hourlySalay;
	}
	public void setHourlySalay(double hourlySalay) {
		this.hourlySalay = hourlySalay;
	}
	public double getHours() {
		return hours;
	}
	public void setHours(double hours) {
		this.hours = hours;
	}
	
	
}
